package com.kx.simple_factory_mode;

/**
 * Created on 2021/10/14.
 *
 * @author KaiXuan Xiao
 */
///////////////////////////////////////////////////////////////////////////
// 除法
///////////////////////////////////////////////////////////////////////////
public class OperationDiv extends Operation {

    @Override
    public double getResult() throws Exception {
        double result = 0;
        if (get_numberB()==0){
            throw new Exception("除数不能为0");
        }

        result = get_numberA() / get_numberB();
        return result;
    }
}
